<?php
class ArticleCategory extends AppModel {
    var $name = 'ArticleCategory';

    var $hasMany = array('Article' => array('foreignKey' => 'category_id'));

    function beforeDelete(){
        $this->Article->updateAll(array('Article.category_id' => '0'),    array('Article.category_id =' => $this->id));

        return true;
    }
}
?>
